#include "window.h"
#include "plan.h"
#include "arbre.h"
#include "teapot.h"
#include "text.h"
#include "soucoupe.h"
#include "maLumiere.h"
#include "neon.h"
#include "pointeur.h"
#include "texture.h"


int main(int argc, char**argv)
{
  Window *win = WindowCreator::createWindow("toto",0,0,250,250,&argc,argv);
    


//  Image img;
//  ImageLoader::loadTGA("GCN.tga",&img);



//Un pointeur
string * pouet2 = new string("plopouet");
Pointeur * p = new Pointeur(1,pouet2);
p->setPosition (10,0.5,0.0);


//Du texte
string * pouet = new string("pouet");
Material *m = MaterialCreator::createGold();
Text t(GLUT_BITMAP_TIMES_ROMAN_24, pouet);
t.setMaterial(m);
t.setPosition(20.0,10.0,1.0);    


  //Les lumieres
   Lumiere lum;
   lum.setPosition(0,5,10);
   lum.setDiffuse(1.0,0.81,0.43,1.0);
   lum.setCutoff(180.0);
   lum.setSpecular(1.0,0.0,0.0,1.0);
  // lum.setDirection(0.0,-5.0,-10.0);

  //Lumiere du neon
   Lumiere lumNeon;
   lumNeon.setDiffuse(1.0,0.0,0.0,1.0);
   lumNeon.setAmbient(1.0,0.0,0.0,1.0);
   lumNeon.setCutoff(180.0);
//   lumNeon.setExponent(100)*
    Lumiere lumNeon2;
    lumNeon2.setDiffuse(1.0,0.0,0.0,0.1);
    lumNeon2.setAmbient(1.0,0.0,0.0,0.1);

  //Materiau du neon (transparent)
  Material mNeon;
  mNeon.setDiffuse(0.0,1.0,0.0,0.2);
  mNeon.setEmissive(0.0,1.0,0.0,0.2);
  mNeon.setShininess(0);

  //le neon
  Neon neon(1);
  neon.setMaterial(&mNeon);
  neon.setLumiere(&lumNeon);
  neon.setLumiere2(&lumNeon2);
  neon.setPosition(-1.5,0.0,0.0);
//  neon.setRadius(2);

  Neon neon2(1);
  neon2.setMaterial(&mNeon);
  neon2.setLumiere(&lumNeon);
  neon2.setLumiere2(&lumNeon2);
  neon2.setPosition(1.5,0.0,0.0);

   //les objets
//   Plan plan(10.0, 10.0);
//   plan.setPosition(-12.0,5.0,0.0);
//   Arbre2 arbre;
//   arbre.setPosition(3.0,6.0,0.0);


//Soucoupe
Soucoupe s;
//Material * m2 = MaterialCreator::createJade();
//s.setMaterial(m2);
  s.setPilote("pilote.png");

   Teapot tp;
tp.setPosition(0.0,-2.0,0.0);
  Scene scene;
//  scene.addObjet(&t);
  scene.addObjet(&tp);
  scene.addObjet(&s);
//  scene.addObjet(&plan);
//  scene.addObjet(&arbre);
//  scene.addNeon(&neon);
//  scene.addNeon(& neon2);
  scene.addObjet(p);
//  scene.addLumiere(&lum);

  scene.addTimerListener(&s);
  //   
  win->setScene(&scene);
  win->mainLoop();
  return 0;
}
